<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
.STYLE1 {font-size: 24px}
.STYLE2 {font-size: 70px}
.STYLE7 {font-size: smaller}
.STYLE6 {font-size: medium}
-->
</style>
 	
	<!-- start about us -->
		<?php
		//初始化模板参数:$this->aboutusTitle、$this->aboutusTitleImg
		$this->aboutusTitle = 
		'四川大学网上第二课堂的近期活动旨在更为直观的汇总近期学校内将要举办的各类讲座比赛，
		消息来源于教务处、校团委以及青春广场上的各类通知';
		$this->aboutusTitleImg = $this->baseUrl().'/images/recentactTitleImg.jpg';
		
		$aboutusLayout = new Zend_Layout();
		echo $aboutusLayout->render('/module/aboutus');
		?>
	<!-- end about us -->
	
	<!-- start logos -->
	<div class="logos">
		
	</div>
	<!-- end logos -->
	
	<!-- start content -->
	<div id="vg-content">

		<!-- start portfolio details -->
		<div id="portfolio-details" class="vg-page">
		
			<!-- start details -->
			<?php
				//左侧信息
				$this->fromhref = '?fromhref=/recentact/index';
				if($this->isloggin==true)
				{
					$userinfoLayout = new Zend_Layout();
					echo $userinfoLayout->render('/module/userinfo');
				}
				else
				{
					//左侧登录
					
					$loginLayout = new Zend_Layout();
					echo $loginLayout->render('/module/login');
				}  
			?>
			<article class="border-top c-four height-auto">
				<div class="vg-item-article vg-portfolio-details" syle="border:1px solid;">
					<!-- title -->
					<form id="searchform" name="searchform" action="<?php echo $this->baseUrl().'/recentact/search'?>" method="post">
					<h1 class="STYLE6">搜索你想要的活动
					  <label>
						  <input type="text" id="searchbox" name="searchbox" onkeypress="searchEnter()">
					  <br>
					  <br>
					  </label>
					</h1>
					</form>
					<!-- end title -->
					<!-- upload start -->
					<!-- upload ends -->
					<?php
						
						Zend_Loader::loadFile('/functions/msubstr.php');
						
						if(isset($this->isSearchMode)&&$this->isSearchMode&&isset($this->searchTips))
						{
							echo '<h3 class="searchTips">'.$this->searchTips.'</h3>';
						}
					?>
					<!-- download list -->
					
					<div class="activityblock">
						<ul>
						<!-- 静态模板 
						<li><a href="<?php echo $this->baseUrl().'/recentact/detail'?>" id="title" name="title">hehe</a><div class="progressbar"><div class="red" style="width:20%"></div></div><div class="zan">[2012.7.5]好评20%</div></li></li>
						<li><a href="<?php echo $this->baseUrl().'/recentact/detail'?>" id="title" name="title">我是公主，计算机学院系列活动,我是公主，计算机学院系列活动</a><div class="progressbar"><div class="red" style="width:70%"></div></div><div class="zan">[2012.7.5]好评70%</div></li>
						 -->
						<?php
							if(count($this->allacts)==0)
							{
								echo '没有任何活动';
							}
							foreach($this->allacts as $act)
							{
							    $countall = $act['countgood']+$act['countsoso']+$act['countbad'];
							    if($countall==0)$goodrate = 0;
							    else $goodrate = intval(100*$act['countgood']/$countall);
							    echo '<li><a href="'.$this->baseUrl().'/recentact/detail?actid='.$act['id'].'"';
							    echo ' id="title" name="title">';
							    
							    echo cut_str($act['title'],16);
							    
							    echo '</a><div class="progressbar"><div class="red" style="width:';
							    echo $goodrate.'%">';
							    echo '</div></div><div class="zan">';
							    echo '['.gmdate('Y-m-d',$act['date']+8*3600).']';
							    echo '好评'.$goodrate.'%</div></li>';
							} 
						?>
						
						</ul>
						<?php
							 
						?>

					</div>
					
					<!-- enddownload list -->
					<!-- pager start -->
					<?php
					if(isset($this->isSearchMode)&&$this->isSearchMode)
					{
						;//搜索的时候不分页
					}
					else
					{
					    //初始化模板参数:$this->pagerUrl
					    $this->pagerUrl = $this->baseUrl().'/recentact/index';
					    	
					    $aboutusLayout = new Zend_Layout();
					    echo $aboutusLayout->render('/module/pager');
					}
					?>		
					<!-- pager end -->
			  </div>
				
			</article>
			<!-- end details -->
			
	  </div>
	  <!-- end portfolio details -->
		
	</div>
	<!-- end content -->

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-23864149-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  function searchEnter(){
	if(event.keyCode==13){
		document.getElementById('searchform').submit();
		return false;
	}  
  }
</script>